<? require_once("TestAssertion.php"); ?>
<? require_once("TestMethod.php"); ?>
<? require_once("TestSet.php"); ?>
<? require_once("TestFolder.php"); ?>

<?#DELETE>>>?>
<? require_once("clean_html_code.php"); ?>
<?#<<<DELETE?>

<?#DELETE>>>?>
<?

function pre_print($obj) {
  echo "<pre>";print_r($obj);echo "</pre>";
}
function s($bool) { return $bool ? "true" : "false"; }

?>
<?#<<<DELETE?>

<? $here = new TestFolder("."); ?>

<html>
<head>
<script type="text/javascript">
<? require("script.js"); ?>
</script>

<style>
<? require_once("style.css"); ?>
</style>
</head>

<body>

<div id="TopBar">
  Welcome to <b>Ditter</b>, the drop-in php testing framework! 

  <a href="javascript: toggle_div('Help');">Show help</a>
</div>

<div id="Help" class="<?= count($here->files) > 0 ? 'Hidden' : 'Visible' ?>">
  <p>In order for this to work, it needs to be in a folder with at least one 
  file that starts with 'test_' and ends with '.php'.  And in that
  test_whatever.php file you should have something that looks like this:</p>

  <pre>&lt;?
class test_whatever extends TestSet {
  test_true_should_be_true() {
    $this->assert(true);
  }
  test_false_should_be_false() {
    $this->assert_false(false);
  }
  test_41_is_41() {
    $this->assert_equal(41,41);
  }
  test_gram_should_match_programming() {
    $this->assert_match("gram", "programming");
  }
  test_me_should_not_match_team() {
    $this->assert_should_not_match('me', 'team');
  }
}
?&gt;</pre>

  <p>Remember, your class name needs to match the filename, and your test
  methods all need to start with 'test_'.</p>

  <p><a href="javascript: toggle_div('Help');">Hide help</a></p>
</div>

<div id="Page">

  <?php $here->run_and_print(); ?>

</div>
</body>
</html>

